//
//  HRZUpDownButton.m
//  EMarket
//
//  Created by 石头 on 2018/5/14.
//  Copyright © 2018年 好日子. All rights reserved.
//

#import "HRZUpDownButton.h"
#import "UIView+SPExtension.h"

@implementation HRZUpDownButton

#pragma mark - Intial
-(void)setUp
{
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    [self setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setUp];
    }
    return self;
}
- (void)awakeFromNib
{
    [super awakeFromNib];
    [self setUp];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.imageView.sp_centerX = self.sp_width * 0.5;
    self.imageView.sp_centerY  =  self.sp_height * 0.3;
    
    [self.titleLabel sizeToFit];
    self.titleLabel.sp_centerX = self.sp_width * 0.5;
    self.titleLabel.sp_y  =  self.imageView.sp_bottom + self.sp_height * 0.12;
}

@end
